<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport"
          content="width=device-width,  user-scalable=no">

    <title>腰痛评定表</title>

    <!--<link href="/css/bootstrap.min.css" rel="stylesheet">-->
    <!--<link href="/css/font-awesome/css/font-awesome.css" rel="stylesheet">-->

    <!--<link href="/css/animate.css" rel="stylesheet">-->
    <!--<link href="/css/style.css" rel="stylesheet">-->
    <!--<link href="/css/ics/common.css" rel="stylesheet">-->


    <style>

        /*.text{*/
        /*background-color: #FFFFFF;*/
        /*background-image: none;*/
        /*border: 1px solid #e5e6e7;*/
        /*border-radius: 1px;*/
        /*color: inherit;*/
        /*display: inline-block;*/
        /*padding: 6px 12px;*/
        /*transition: border-color 0.15s ease-in-out 0s, box-shadow 0.15s ease-in-out 0s;*/
        /*width: 100%;*/
        /*font-size: 14px;*/
        /*}*/

        .content td {
            font-size: 13px;
        }

        #table_guage{
            width: 100%;
        }

    </style>


</head>

<body>
<form id="lumbago-form">

    <div id="div_lumbago">
        <div style="font-size: 16px;height: 26px;margin-bottom: 26px;border-bottom: 1px solid #d0d0d0;">
            <label class="print-font16">评定内容</label>
        </div>
        <div class="hide">
            <table border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td align="left" width="80px"><label style="font-size: 13px">陪同者</label></td>
                    <td align="left"><input type="text" class="form-control" style="width: 200px" id="text_companion"/>
                    </td>
                </tr>
            </table>

        </div>

        <!--<div class="view-page hide">-->
        <!--<table border="0" cellspacing="0" cellpadding="0">-->
        <!--<tr>-->
        <!--<td align="left" width="80px"><label style="font-size: 18px">陪同者</label></td>-->
        <!--<td align="left"><label id="span_companion" style="font-weight:normal;font-size: 18px"></label></td>-->
        <!--</tr>-->
        <!--</table>-->
        <!--</div>-->


        <div class="row" style="margin-top: 26px">
            <!--<hr style='margin-bottom:13px;height:1px;border:none;border-top:1px dashed #d0d0d0;'/>-->
            <div class="col-sm-3"><label style="left: 0px;font-size: 14px">生命体征</label></div>
            <div class="col-sm-9" style="font-size: 14px;">
                <table class="content" style="width: 100%">
                    <tr>
                        <td  width="25%" align="right">体温(℃) &nbsp</td>
                        <td align="left"><input  class="form-control" style="width: 200px"
                                                id="text_temperature">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" height="6.5px"></td>
                    </tr>
                    <tr>
                        <td align="right" width="25%">心率(次/分) &nbsp</td>
                        <td align="left"><input  class="form-control" style="width: 200px"
                                                id="text_heart_rate"></td>
                    </tr>
                    <tr>
                        <td colspan="3" height="6.5px"></td>
                    </tr>
                    <tr>
                        <td align="right" width="25%">呼吸(次/分) &nbsp</td>
                        <td align="left"><input  class="form-control" style="width: 200px"
                                                id="text_breathing_rate"></td>
                    </tr>
                    <tr>
                        <td colspan="3" height="6.5px"></td>
                    </tr>
                    <tr>
                        <td align="right" width="25%">血压(mmHg) &nbsp</td>
                        <td align="left">
                            <!--<table width="200px">-->
                            <!--<tr>-->
                            <!---->
                            <!--<td width="95px" align="left">-->
                            <!--<input type="text" class="text" style="width: 90px"-->
                            <!--id="text_systolic_pressure">-->
                            <!--</td>-->
                            <!--<td width="10px">/</td>-->
                            <!--<td width="95px" align="left">-->
                            <!--<input type="text" class="text" style="width: 90px"-->
                            <!--id="text_diastolic_pressure">-->
                            <!--</td>-->
                            <!--</tr>-->
                            <!--</table>-->
                            <input  class="form-control" style="width: 90px;display: inline-block;"
                                   id="text_systolic_pressure">
                            <span style="width: 20px!important;">&nbsp/&nbsp</span>
                            <input  class="form-control" style="width: 90px;display: inline-block;"
                                   id="text_diastolic_pressure">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" height="6.5px"></td>
                    </tr>
                </table>
            </div>

        </div>

        <hr style='margin-top: 6.5px;margin-bottom:13px;height:1px;border:none;border-top:1px dashed #d0d0d0;'/>
        <!--<div style="height: 7vw;" class="row">-->
            <!--<div class="col-sm-3"><label style="left: 0px">疼痛评定*</label></div>-->
            <!--<div class="col-sm-9">-->
                <!--<table class="content">-->
                    <!--<tr>-->
                        <!--<td width="30%">评分* &nbsp</td>-->
                        <!--<td align="left">-->
                            <!--<input type="text" class="form-control" placeholder="请输入0~100之间的数字" style="width: 200px"-->
                                   <!--id="text_assess_pain">-->
                            <!--提示:无痛(0)到剧痛(100)-->
                        <!--</td>-->
                    <!--</tr>-->
                    <!--<tr>-->
                        <!--<td colspan="3" height="6.5px"></td>-->
                    <!--</tr>-->
                <!--</table>-->
            <!--</div>-->

        <!--</div>-->
        <div class="row">
            <div class="col-sm-3"><label style="left: 0px;font-size: 14px">疼痛评定*</label></div>
            <div class="col-sm-9">
                <!--<div style="width: 100%;height: 1px; background-color: #c2c2c2;"></div>-->
                <input type="text" name="2-1" class="question-item form-control" id="slider_result" readonly="true" disabled="disabled"
                       style="width: 4em;" value="0">
                <input type="range" name="2-2" class="question-item" max="100" min="0" step="1"
                       onchange="$('#slider_result').val($(this).val());" value="0">
                <div style="font-size: 12px;">提示：无痛(0)到剧痛(100)</div>
            </div>
        </div>
        <hr style='margin:6.5px auto;height:1px;border:none;border-top:1px dashed #d0d0d0;'/>
        <div  class="row">
            <div class="col-sm-3"><label style="left: 0px;font-size: 14px">痛强度*</label></div>
            <div class="col-sm-9" style="font-size: 14px;">
                <table class="content" style="width: 100%">
                    <tr>
                        <!--<td align="left" style="vertical-align: top" width="30%">强度* &nbsp</td>-->
                        <td align="left">
                            <table>
                                <tr>
                                    <td>
                                        <input type="radio" name="radio_pain_intensity" value="0">
                                        无痛
                                    </td>
                                    <td>
                                        <input type="radio" name="radio_pain_intensity" value="1">
                                        轻度不适
                                    </td>
                                    <td>
                                        <input type="radio" name="radio_pain_intensity" value="2">
                                        不适
                                    </td>
                                <!--</tr>-->
                                <!--<tr>-->
                                    <td>
                                        <input type="radio" name="radio_pain_intensity" value="3">
                                        难受
                                    </td>
                                    <td>
                                        <input type="radio" name="radio_pain_intensity" value="4">
                                        可怕的痛
                                    </td>
                                    <td>
                                        <input type="radio" name="radio_pain_intensity" value="5">
                                        极为痛苦
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" height="6.5px"></td>
                    </tr>
                </table>
            </div>

        </div>

        <hr style='margin-bottom:13px;margin-top:6.5px;height:1px;border:none;border-top:1px dashed #d0d0d0;'/>
        <div  class="row">
            <div class="col-sm-3"><label style="left: 0px;font-size: 14px">手指指地距离*</label></div>
            <div class="col-sm-9" style="font-size: 14px;">

            <table class="content" style="width: 100%">
                    <tr>
                        <td width="25%" align="right">距离(厘米)* &nbsp</td>
                        <td align="left"><input type="text" placeholder="请输入0~100之间的数字" class="form-control"
                                                style="width: 200px"
                                                id="text_ground_clearance_finger">
                            <!--提示:即腰椎前屈时中指指尖与地面的距离，注意弯腰时膝关节伸直-->
                        </td>
                    </tr>
                    <tr>
                        <td width="25%" align="right"></td>
                        <td align="left"><div style="font-size: 13px!important;text-align: left;width: 105%;margin-right: -5%">提示:即腰椎前屈时中指指尖与地面的距离，注意弯腰时膝关节伸直</div></td>
                    </tr>
                    <tr>
                        <td colspan="2" height="6.5px"></td>
                    </tr>
                </table>
            </div>

        </div>

        <hr style='margin-top:6.5px;margin-bottom:13px;height:1px;border:none;border-top:1px dashed #d0d0d0;'/>
        <div  class="row">
            <div class="col-sm-3"><label style="left: 0px;font-size: 14px">等速肌力测试*</label></div>
            <div class="col-sm-9" style="font-size: 14px;">

            <table class="content" width="100%">
                    <tr>
                        <td align="right" width="25%">峰值力矩(屈肌)* &nbsp</td>
                        <td align="left"><input type="text" class="form-control" id="text_peak_torque_flexor"></td>
                    </tr>
                    <tr>
                        <td colspan="2" height="6.5px"></td>
                    </tr>
                    <tr>
                        <td align="right" width="25%">峰值力矩(伸肌)* &nbsp</td>
                        <td align="left"><input type="text" class="form-control" id="text_peak_torque_extensor"></td>
                    </tr>
                    <tr>
                        <td colspan="2" height="6.5px"></td>
                    </tr>
                    <tr>
                        <td align="right" width="25%"><div style="margin-left: -30%;width: 130%;text-align: right;font-size: 13px!important;">峰值力矩体重比(屈肌)* &nbsp</div></td>
                        <td align="left"><input type="text" class="form-control" id="text_peak_torque_weight_flexor">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" height="6.5px"></td>
                    </tr>
                    <tr>
                        <td align="right" width="25%"><div style="margin-left: -30%;width: 130%;text-align: right;font-size: 13px!important;">峰值力矩体重比(伸肌)* &nbsp</div></td>
                        <td align="left"><input type="text" class="form-control" id="text_peak_torque_weight_extensor">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" height="6.5px"></td>
                    </tr>
                    <tr>
                        <td align="right" width="25%"><div style="margin-left: -20%;width: 120%;text-align: right;font-size: 13px!important;">屈伸肌群峰值力矩比 * &nbsp</div></td>
                        <td align="left"><input type="text" class="form-control"
                                                id="text_peak_torque_weight_extensor_flexor"></td>
                    </tr>
                </table>
            </div>
        </div>
        <hr style='margin-top:13px;height:1px;border:none;border-top:1px dashed #d0d0d0;'/>

        <div class="edit-page hide" style="margin-top: 13px">
            <div class="col-sm-8 col-sm-offset-4">
                <button class="btn btn-white col-sm-3" type="button" onclick="myReset()">重置</button>
                <button class="btn btn-primary col-sm-3 col-sm-offset-1" onclick="submitGaugeResult()" type="button">提交</button>
            </div>
        </div>
    </div>


</form>
</body>

<script>

    var textCompanion = $("#text_companion");
    var spanCompanion = $("#span_companion");

    var textTemperature = $("#text_temperature");
    var textHeartRate = $("#text_heart_rate");
    var textBreathingRate = $("#text_breathing_rate");
    var sliderResult = $("#slider_result");
//    var textAssessPain = $("#text_assess_pain");
    var textGroundClearanceFinger = $("#text_ground_clearance_finger");
    var textSystolicPressure = $("#text_systolic_pressure");
    var textDiastolicPressure = $("#text_diastolic_pressure");

    var textPeakTorqueFlexor = $("#text_peak_torque_flexor");
    var textPeakTorqueExtensor = $("#text_peak_torque_extensor");
    var textPeakTorqueWeightFlexor = $("#text_peak_torque_weight_flexor");
    var textPeakTorqueWeightExtensor = $("#text_peak_torque_weight_extensor");
    var textPeakTorqueWeightExtensorFlexor = $("#text_peak_torque_weight_extensor_flexor");

    var editPage = $(".edit-page");
    var viewPage = $(".view-page");


    function getGaugeResult() {

//        if(textCompanion.val().trim()==null||textCompanion.val().trim()==''){
//            utils.msgError("请填写陪同者!");
//            return;
//        }

//        if (textTemperature.val() == null || textTemperature.val().trim() == '') {
//            utils.msgError("请填写体温!");
//            textTemperature.focus();
//            return;
//        }
        if(textTemperature.val()!=null&&textTemperature.val()!='') {
            if (isNaN(textTemperature.val()) || parseFloat(textTemperature.val()) != textTemperature.val()) {
                utils.msgError("体温必须为数字!");
                textTemperature.focus();
                return;
            }
            if (parseFloat(textTemperature.val()) > 45 || parseFloat(textTemperature.val()) < 25) {
                utils.msgError("体温必须在25~45度之间!");
                textTemperature.focus();
                return;
            }
        }

//        if (textHeartRate.val() == null || textHeartRate.val().trim() == '') {
//            utils.msgError("请填写心率!");
//            textHeartRate.focus();
//            return;
//        }
        if(textHeartRate.val()!=null&&textHeartRate.val()!='') {
            if (isNaN(textHeartRate.val()) || parseInt(textHeartRate.val()) != textHeartRate.val()) {
                utils.msgError("心率必须为整数!");
                textHeartRate.focus();
                return;
            }
            if (parseInt(textHeartRate.val()) > 200 || parseInt(textHeartRate.val()) < 0) {
                utils.msgError("心率在0~200之间!");
                textHeartRate.focus();
                return;
            }
        }


//        if (textBreathingRate.val() == null || textBreathingRate.val().trim() == '') {
//            utils.msgError("请填写呼吸!");
//            textBreathingRate.focus();
//            return;
//        }
        if(textBreathingRate.val()!=null&&textBreathingRate.val()!='') {
            if (isNaN(textBreathingRate.val()) || parseInt(textBreathingRate.val()) != textBreathingRate.val()) {
                utils.msgError("呼吸必须为整数!");
                textBreathingRate.focus();
                return;
            }
            if (parseInt(textBreathingRate.val()) > 200 || parseInt(textBreathingRate.val()) < 0) {
                utils.msgError("呼吸在0~200之间!");
                textBreathingRate.focus();
                return;
            }
        }

//        if (textSystolicPressure.val() == null || textSystolicPressure.val().trim() == '') {
//            utils.msgError("请填写血压!");
//            textSystolicPressure.focus();
//            return;
//        }

        if(textSystolicPressure.val()!=null&&textSystolicPressure.val()!='') {
            if (isNaN(textSystolicPressure.val()) || parseInt(textSystolicPressure.val()) != textSystolicPressure.val()) {
                utils.msgError("血压必须为整数!");
                textSystolicPressure.focus();
                return;
            }
            if (parseInt(textSystolicPressure.val()) > 300 || parseInt(textSystolicPressure.val()) < 0) {
                utils.msgError("舒张压在0~300!");
                textSystolicPressure.focus();
                return;
            }
        }

//        if (textDiastolicPressure.val() == null || textDiastolicPressure.val().trim() == '') {
//            utils.msgError("请填写血压!");
//            textDiastolicPressure.focus();
//            return;
//        }

        if(textDiastolicPressure.val()!=null&&textDiastolicPressure.val()!='') {
            if (isNaN(textDiastolicPressure.val()) || parseInt(textDiastolicPressure.val()) != textDiastolicPressure.val()) {
                utils.msgError("血压必须为整数!");
                textDiastolicPressure.focus();
                return;
            }
            if (parseInt(textDiastolicPressure.val()) > 300 || parseInt(textDiastolicPressure.val()) < 0) {
                utils.msgError("收缩压在0~300!");
                textDiastolicPressure.focus();
                return;
            }
        }


        if (sliderResult.val() == null || sliderResult.val().trim() == '') {
            utils.msgError("请填写疼痛评定!");
            sliderResult.focus();
            return;
        }
//
//        if (textAssessPain.val() == null || textAssessPain.val().trim() == '') {
//            utils.msgError("请填写疼痛评定!");
//            textAssessPain.focus();
//            return;
//        }
//        if (isNaN(textAssessPain.val()) || parseInt(textAssessPain.val()) != textAssessPain.val()) {
//            utils.msgError("疼痛评定必须为整数!");
//            textAssessPain.focus();
//            return;
//        }
//        if (parseInt(textAssessPain.val()) > 100 || parseInt(textAssessPain.val()) < 0) {
//            utils.msgError("疼痛评定必须在0~100之间!");
//            textAssessPain.focus();
//            return;
//        }


        var radioPainIntensity = $("input[name='radio_pain_intensity']:checked").val();

        if (typeof(radioPainIntensity) == "undefined") {
            utils.msgError("请选择痛强度!");
            $("input[name='radio_pain_intensity']").focus();
            return;
        }

        if (textGroundClearanceFinger.val() == null || textGroundClearanceFinger.val().trim() == '') {
            utils.msgError("请填写手指离地距离!");
            textGroundClearanceFinger.focus();
            return;
        }
        if (isNaN(textGroundClearanceFinger.val()) || parseInt(textGroundClearanceFinger.val())+'' != textGroundClearanceFinger.val()) {
            utils.msgError("手指离地距离必须为整数!");
            textGroundClearanceFinger.focus();
            return;
        }
        if (parseInt(textGroundClearanceFinger.val()) > 100 || parseInt(textGroundClearanceFinger.val()) < 0) {
            utils.msgError("手指离地距离必须在0~100之间!");
            textGroundClearanceFinger.focus();
            return;
        }

        if (textPeakTorqueFlexor.val() == null || textPeakTorqueFlexor.val().trim() == '') {
            utils.msgError("请填写峰值力矩(屈肌)!");
            textPeakTorqueFlexor.focus();
            return;
        }
        if (textPeakTorqueExtensor.val() == null || textPeakTorqueExtensor.val().trim() == '') {
            utils.msgError("请填写峰值力矩(伸肌)!");
            textPeakTorqueExtensor.focus();
            return;
        }
        if (textPeakTorqueWeightFlexor.val() == null || textPeakTorqueWeightFlexor.val().trim() == '') {
            utils.msgError("请填写峰值力矩体重比(屈肌)!");
            textPeakTorqueWeightFlexor.focus();
            return;
        }
        if (textPeakTorqueWeightExtensor.val() == null || textPeakTorqueWeightExtensor.val().trim() == '') {
            utils.msgError("请填写峰值力矩体重比(伸肌)!");
            textPeakTorqueWeightExtensor.focus();
            return;
        }
        if (textPeakTorqueWeightExtensorFlexor.val() == null || textPeakTorqueWeightExtensorFlexor.val().trim() == '') {
            utils.msgError("请填写屈伸肌群峰值力矩比!");
            textPeakTorqueWeightExtensorFlexor.focus();
            return;
        }


        var result = {};
        result.questions = [];

        var res = {};

        res.key = 'temperature';
        res.value = textTemperature.val();
        result.questions[0] = res;

        res = {};
        res.key = 'heart_rate';
        res.value = textHeartRate.val();
        result.questions[1] = res;

        res = {};
        res.key = 'breathing_rate';
        res.value = textBreathingRate.val();
        result.questions[2] = res;

        res = {};
        res.key = 'assess_pain';
        res.value = sliderResult.val();
        result.questions[3] = res;

        res = {};
        res.key = 'ground_clearance_finger';
        res.value = textGroundClearanceFinger.val();
        result.questions[4] = res;

        res = {};
        res.key = 'systolic_pressure';
        res.value = textSystolicPressure.val();
        result.questions[5] = res;

        res = {};
        res.key = 'diastolic_pressure';
        res.value = textDiastolicPressure.val();
        result.questions[6] = res;

        res = {};
        res.key = 'radio_pain_intensity';
        res.value = radioPainIntensity;
        result.questions[7] = res;

        res = {};
        res.key = 'peak_torque_flexor';
        res.value = textPeakTorqueFlexor.val();
        result.questions[8] = res;

        res = {};
        res.key = 'peak_torque_extensor';
        res.value = textPeakTorqueExtensor.val();
        result.questions[9] = res;

        res = {};
        res.key = 'peak_torque_weight_flexor';
        res.value = textPeakTorqueWeightFlexor.val();
        result.questions[10] = res;

        res = {};
        res.key = 'peak_torque_weight_extensor';
        res.value = textPeakTorqueWeightExtensor.val();
        result.questions[11] = res;

        res = {};
        res.key = 'peak_torque_weight_extensor_flexor';
        res.value = textPeakTorqueWeightExtensorFlexor.val();
        result.questions[12] = res;

        result.companion = textCompanion.val().trim();
//        spanCompanion.text(result.companion);
        textCompanion.val(result.companion);
        debugAlert(result);
        return result;
    }

    function setGaugeResult(result) {

        var questions = result.questions;
        for (var k = 0; k < questions.length; k++) {
            if (questions[k].key == 'temperature') {
//                textTemperature.val(questions[k].value);
                textTemperature.attr("value",questions[k].value);
            } else if (questions[k].key == 'heart_rate') {
//                textHeartRate.val(questions[k].value);
                textHeartRate.attr("value",questions[k].value);
            } else if (questions[k].key == 'breathing_rate') {
//                textBreathingRate.val(questions[k].value);
                textBreathingRate.attr("value",questions[k].value);
            } else if (questions[k].key == 'assess_pain') {
//                sliderResult.val(questions[k].value);
                sliderResult.attr("value",questions[k].value);
                $('#div_lumbago input[name=2-2]').val(questions[k].value);
            } else if (questions[k].key == 'ground_clearance_finger') {
//                textGroundClearanceFinger.val(questions[k].value);
                textGroundClearanceFinger.attr("value",questions[k].value);
            } else if (questions[k].key == 'systolic_pressure') {
//                textSystolicPressure.val(questions[k].value);
                textSystolicPressure.attr("value",questions[k].value);
            } else if (questions[k].key == 'diastolic_pressure') {
//                textDiastolicPressure.val(questions[k].value);
                textDiastolicPressure.attr("value",questions[k].value);
            } else if (questions[k].key == 'radio_pain_intensity') {
                $("input[name='radio_pain_intensity'][value=" + questions[k].value + "]").attr("checked", 'checked');
            } else if (questions[k].key == 'peak_torque_flexor') {
//                textPeakTorqueFlexor.val(questions[k].value);
                textPeakTorqueFlexor.attr("value",questions[k].value);
            } else if (questions[k].key == 'peak_torque_extensor') {
//                textPeakTorqueExtensor.val(questions[k].value);
                textPeakTorqueExtensor.attr("value",questions[k].value);
            } else if (questions[k].key == 'peak_torque_weight_flexor') {
//                textPeakTorqueWeightFlexor.val(questions[k].value);
                textPeakTorqueWeightFlexor.attr("value",questions[k].value);
            } else if (questions[k].key == 'peak_torque_weight_extensor') {
//                textPeakTorqueWeightExtensor.val(questions[k].value);
                textPeakTorqueWeightExtensor.attr("value",questions[k].value);
            } else if (questions[k].key == 'peak_torque_weight_extensor_flexor') {
//                textPeakTorqueWeightExtensorFlexor.val(questions[k].value);
                textPeakTorqueWeightExtensorFlexor.attr("value",questions[k].value);
            }
        }

        if (result.companion == null || result.companion == '') {
//            spanCompanion.text("无");
        } else {
            textCompanion.val(result.companion);
//            spanCompanion.text(result.companion);
        }
    }



    function setEditable(edit) {

        if (edit == true || edit == 'true') {
            editPage.removeClass('hide');
            viewPage.addClass('hide');
        } else {
            textCompanion.attr("disabled", true);
            viewPage.removeClass('hide');
            editPage.addClass('hide');
            $("input").attr('disabled', 'disabled');
        }

    }

    function getCount() {

    }
</script>

</html>
